tests: Drop use of host_refspec
authorColin Walters <walters@verbum.org>
Tue, 29 Apr 2025 22:16:31 +0000 (18:16 -0400)
committerColin Walters <walters@verbum.org>
Tue, 29 Apr 2025 22:33:29 +0000 (18:33 -0400)
There's no refspec on FCOS now using containers.
We never needed a refspec for any of these, just the commit.

tests/kolainst/data-shared/libinsttest.sh
tests/kolainst/destructive/auto-prune.sh
tests/kolainst/destructive/deployment-lint
tests/kolainst/destructive/itest-bare-root.sh
tests/kolainst/destructive/itest-deploy-selinux.sh
tests/kolainst/destructive/itest-label-selinux.sh
tests/kolainst/destructive/overlay-initrds.sh
tests/kolainst/nondestructive/itest-pull.sh

index 927dc5e1e690467d60cf6005360ea82bcdc83bd0..abfcdb8e6b4311b076e4dcf17a26ffe91fb35ed6 100644 (file)
@@ -77,6 +77,5 @@ rpmostree_query_json() {
     query=$1
     rpm-ostree status --json | jq -r "${query}"
 }
-host_refspec=$(rpmostree_query_json '.deployments[0].origin')
 host_commit=$(rpmostree_query_json '.deployments[0].checksum')
 host_osname=$(rpmostree_query_json '.deployments[0].osname')
index 38e88af019175a80948173b68ecc731d68cd4984..9d974590eaf20f211592f7fb8fd2ccc12c3ce5b5 100755 (executable)
@@ -40,9 +40,9 @@ cd /root
 mkdir -p rootfs/usr/lib/modules/`uname -r`
 cp /usr/lib/modules/`uname -r`/vmlinuz rootfs/usr/lib/modules/`uname -r`
 dd if=/dev/urandom of=rootfs/usr/lib/modules/`uname -r`/vmlinuz count=1 conv=notrunc status=none
-ostree commit --base "${host_refspec}" -P --tree=dir=rootfs -b modkernel1
+ostree commit --base "${host_commit}" -P --tree=dir=rootfs -b modkernel1
 dd if=/dev/urandom of=rootfs/usr/lib/modules/`uname -r`/vmlinuz count=1 conv=notrunc status=none
-ostree commit --base "${host_refspec}" -P --tree=dir=rootfs -b modkernel2
+ostree commit --base "${host_commit}" -P --tree=dir=rootfs -b modkernel2
 
 assert_bootfs_has_n_bootcsum_dirs() {
     local expected=$1; shift
index 7ef403d0123280b4a3ae5114f07088389b75cd6f..3aeefffec02ae4c1f22c51d68280e182725b602a 100755 (executable)
@@ -7,7 +7,7 @@ require_writable_sysroot
 prepare_tmpdir
 
 mkdir -p rootfs/var/testcontent
-ostree commit -b testlint --no-bindings --selinux-policy-from-base --tree=ref="${host_refspec}" --consume --tree=dir=rootfs
+ostree commit -b testlint --no-bindings --selinux-policy-from-base --tree=ref="${host_commit}" --consume --tree=dir=rootfs
 ostree admin deploy testlint 2>err.txt
 assert_not_file_has_content err.txt 'Deploying commit.*which contains content in /var/testcontent'
 test '!' -d /var/testcontent
index 2834a829b5bab084e258955407d8fdc2d2da1ec5..71cd1b2b3272e7b50387dcf0a4708f8f518df101 100755 (executable)
@@ -15,7 +15,7 @@ cd /ostree/repo/tmp
 rm co -rf
 rm co-testref -rf
 ostree refs --delete testref
-ostree checkout -H ${host_refspec} co
+ostree checkout -H ${host_commit} co
 victim_symlink=/usr/bin/gtar  # Seems likely to stick around
 # Copy the link to avoid corrupting it
 cp co/${victim_symlink}{,.tmp}
@@ -27,7 +27,7 @@ csum=$(ostree commit -b testref --link-checkout-speedup --tree=dir=co)
 ostree fsck
 ostree ls -X testref ${victim_symlink} > ls.txt
 assert_file_has_content ls.txt 'security\.biometric'
-ostree ls -X ${host_refspec} ${victim_symlink} > ls.txt
+ostree ls -X ${host_commit} ${victim_symlink} > ls.txt
 assert_not_file_has_content ls.txt 'security\.biometric'
 ostree ls -X testref usr/bin > ls.txt
 assert_file_has_content ls.txt 'security\.crunchy'
index 099b5c27c1d425f3df39371e23697ffc539bb9c6..004aa9c9175761c79df373c5ebedfc684723d7b5 100755 (executable)
@@ -10,7 +10,7 @@ require_writable_sysroot
 
 date
 # Create a new deployment
-ostree admin deploy --karg-proc-cmdline ${host_refspec}
+ostree admin deploy --karg-proc-cmdline ${host_commit}
 new_deployment_path=/ostree/deploy/${host_osname}/deploy/${host_commit}.1
 
 # Test /etc directory mtime
index f166b611c29aac172bb5077cba6e9de3bab55510..ec242517d6d9cbbc983e19cf89313cd274a2e307 100755 (executable)
@@ -11,7 +11,7 @@ prepare_tmpdir /var/tmp
 date
 cd /ostree/repo/tmp
 rm co -rf
-ostree checkout -H ${host_refspec} co
+ostree checkout -H ${host_commit} co
 testbin=co/usr/bin/foo-a-generic-binary
 assert_not_has_file "${testbin}"
 # Make a test binary that we label as shell_exec_t on disk, but should be
@@ -45,9 +45,9 @@ ostree refs --delete testbranch
 rm co -rf
 echo "ok commit with sepolicy"
 
-ostree ls -X ${host_refspec} /usr/etc/sysctl.conf > ls.txt
+ostree ls -X ${host_commit} /usr/etc/sysctl.conf > ls.txt
 if grep -qF ':etc_t:' ls.txt; then
-  ostree checkout -H ${host_refspec} co
+  ostree checkout -H ${host_commit} co
   ostree commit -b testbranch --link-checkout-speedup \
        --selinux-policy co --tree=dir=co --selinux-labeling-epoch=1
   ostree ls -X testbranch /usr/etc/sysctl.conf > ls.txt
@@ -64,7 +64,7 @@ echo "ok --selinux-labeling-epoch=1"
 
 rm rootfs -rf
 if ostree checkout -H \
-    --selinux-policy / ${host_refspec} co; then
+    --selinux-policy / ${host_commit} co; then
   assert_not_reached "checked out with -H and --selinux-policy"
 fi
 # recommit just two binaries into a new branch with selinux labels stripped
@@ -124,7 +124,7 @@ assert_not_file_has_content lsz.txt ':bin_t:'
 rm -f lsz.txt
 echo 'somelib' > usr/lib/somelib.so
 echo 'someconf' > usr/etc/some.conf
-ostree commit -b newbase --selinux-policy-from-base --tree=ref=${host_refspec} --tree=dir=$(pwd)
+ostree commit -b newbase --selinux-policy-from-base --tree=ref=${host_commit} --tree=dir=$(pwd)
 ostree ls -X newbase /usr/bin/somebinary > newls.txt
 assert_file_has_content newls.txt ':bin_t:'
 ostree ls -X newbase /usr/lib/somelib.so > newls.txt
index b24d2d08f627abf07a7aa817bbce5c33eadc22a3..b2c0880f4bf53b4b64fccf0db4b0b82400c0ff0c 100755 (executable)
@@ -31,7 +31,7 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in
   "")
     create_initrd_with_dracut_karg ostree.test1
     # let's use the deploy API first
-    ostree admin deploy "${host_refspec}" \
+    ostree admin deploy "${host_commit}" \
       --overlay-initrd /var/tmp/ostree.test1.img
     /tmp/autopkgtest-reboot "2"
     ;;
@@ -45,7 +45,7 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in
     create_initrd_with_dracut_karg ostree.test2
 
     # let's use the staging API this time
-    ostree admin deploy "${host_refspec}" --stage \
+    ostree admin deploy "${host_commit}" --stage \
       --overlay-initrd /var/tmp/ostree.test2.img
     /tmp/autopkgtest-reboot "3"
     ;;
@@ -64,7 +64,7 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in
     test -f "/boot/ostree/initramfs-overlays/${test2_sha}.img"
 
     # OK, now let's deploy an identical copy of this test
-    ostree admin deploy "${host_refspec}" \
+    ostree admin deploy "${host_commit}" \
       --overlay-initrd /var/tmp/ostree.test2.img
 
     # Now the deployment with ostree.test1 should've been GC'ed; check that its
@@ -74,12 +74,12 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in
 
     # deploy again to check that no bootconfig swap was needed; this verifies
     # that deployment overlay initrds can be successfully compared
-    ostree admin deploy "${host_refspec}" \
+    ostree admin deploy "${host_commit}" \
       --overlay-initrd /var/tmp/ostree.test2.img |& tee /tmp/out.txt
     assert_file_has_content /tmp/out.txt 'bootconfig swap: no'
 
     # finally, let's check that we can overlay multiple initrds
-    ostree admin deploy "${host_refspec}" --stage \
+    ostree admin deploy "${host_commit}" --stage \
       --overlay-initrd /var/tmp/ostree.test1.img \
       --overlay-initrd /var/tmp/ostree.test2.img
     /tmp/autopkgtest-reboot "4"
index 5e8776aa65547db8357e92b8e18cf7a4d2ec5b12..38c4d7c6007dae791cb170c082273cf359815c09 100755 (executable)
@@ -18,7 +18,7 @@ trap _tmpdir_cleanup EXIT
 mkdir repo
 ostree --repo=repo init --mode=archive
 echo -e '[archive]\nzlib-level=1\n' >> repo/config
-host_nonremoteref=$(echo ${host_refspec} | sed 's,[^:]*:,,')
+host_nonremoteref=testref
 log_timestamps() {
     date
     "$@"